//
//  AppEnvr.swift
//  publish10001
//
//  Created by kazarus on 2/25/16.
//  Copyright © 2016 kazarus. All rights reserved.
//

import Foundation

class AppEnvr{
    private static let createOnce = AppEnvr()
    
    var SrvrAddr:String = ""
    var SrvrPort:String = ""
    var RootURLS:String = "121.41.21.35:8187"
    
    class var getInstance :AppEnvr{
    
        return createOnce
    }
    
    init() {
        if let srvrAddr = UserDefaults.standard.string(forKey: "com.kazarus.publish10001.srvraddr"){
            SrvrAddr = srvrAddr;
        }
        
        if let srvrPort = UserDefaults.standard.string(forKey: "com.kazarus.publish10001.srvrport"){
            SrvrPort = srvrPort;
        }
        
        RootURLS = "\(SrvrAddr):\(SrvrPort)"
        print(RootURLS)
    }
    
    
    
}
